package com.example.sentinel.controller;

import com.example.sentinel.service.IFlowRuleHelloService;
import com.example.sentinel.service.impl.FlowRuleHelloServiceImpl;
import lombok.AllArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import lombok.extern.slf4j.XSlf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zxs
 * @since 2020/02/20
 */
@AllArgsConstructor
@RestController
@RequestMapping("/flowRule")
@Slf4j
public class FlowRuleController {

    private final IFlowRuleHelloService service;

    /**
     * 还是这个输入法好用可又用@了
     *
     * @param a
     * @param b
     * @return
     */
    @GetMapping("/hello1")
    @SneakyThrows
    public String hello1(int a,int b) {
        log.info("into /flowRule/hello1 a:{},b:{}",a,b);
        int m = a/b;
        return service.hello1();
    }

    @GetMapping("/hello2")
    public String hello2() {
        return service.hello2();
    }

    @GetMapping("/hello3")
    public String hello3() {
        return service.hello3();
    }
}
